package org.myOrg.spetrum.GUI;

import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

/**
 * 
 * @author XinTao Niu
 * 
 */
public class ResultShowPanel extends JPanel  {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private JTabbedPane tab;
	private ConsolPanel consolePanel;
	private ReadTestSuitePanel readSuiteInfo;
	private RunnedTestsPanel runnedTests;
	private BugModelShowPanel bugModel;
	private ShowPanel tupleStatistic;

	public ResultShowPanel() {
		bulid();
	}

	private void bulid() {
		this.setLayout(new BorderLayout());
		tab = new JTabbedPane();
		consolePanel = new ConsolPanel();
		readSuiteInfo = new ReadTestSuitePanel();
		runnedTests = new RunnedTestsPanel();
		bugModel = new BugModelShowPanel();
		tupleStatistic = new ShowPanel();

		tab.add("console", consolePanel);
		tab.add("readed suite info", readSuiteInfo);
		tab.add("runned tests", runnedTests);
		tab.add("bug Model detected", bugModel);
		tab.add("tuple statistic info", tupleStatistic);

		this.add(tab, BorderLayout.CENTER);
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		JFrame frame = new JFrame();
		frame.setSize(560, 150);
		frame.getContentPane().add(new ResultShowPanel());
		frame.setVisible(true);
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});
	}

}
